{% extends "reg6/reg.html" %}
{% load i18n %}
{% load reg6_filters %}
{% block content %}
<div id="content-main">

{% if attendees and total %}
    <h2>
    You are paying for the following attendee(s):
    </h2>

    <p>
    <table border="1">
    <thead>
    <tr>
    <th>Registration Number</th>
    <th>Name</th>
    <th>Email</th>
    <th>Amount</th>
    </tr>
    </thead>
    <tbody>
    {% for person in attendees %}
    <tr>
        <td>{{ person.id }}</td>
        <td>{{ person.first_name }} {{ person.last_name }}</td>
        <td>{{ person.email }}</td>
        <td>{{ person.ticket_cost|money }}</td>
    </tr>
    {% endfor %}
    </tbody>
    </table>
    </p>

    <p>
    Total: {{ total|money }}
    </p>

    <h2>Credit Card Payments:</h2>

    <p>
    You will now be redirected to our payment gateway. We accept VISA, Mastercard, American Express, and Discover.
    </p>

    <form method="post" action="https://payflowlink.paypal.com/">
    <p>
    <input type="hidden" name="AMOUNT" value="{{ total }}">
    <input type="hidden" name="LOGIN" value="{{ payflow_login }}">
    <input type="hidden" name="PARTNER" value="{{ payflow_partner }} ">
    <input type="hidden" name="TYPE" value="S">
    <input type="hidden" name="USER1" value="{{ order }}">
    {% if kiosk %}
    <input type="hidden" name="USER2" value="Y">
    {% else %}
    <input type="hidden" name="USER2" value="N">
    {% endif %}
    <input type="submit" value="Continue With Credit Card Payment" />
    </p>
    </form>

    <h2>Pay With a Coupon:</h2>

    <p>
    If you have a coupon to redeem, please enter the 10 digit code below:
    </p>

    <form method="post" action="../redeem_coupon/">
    <p>
    <input type="text" name="code" maxlength="15">
    <input type="hidden" name="order" value="{{ order }}">
    <input type="submit" value="Redeem" />
    </p>
    </form>

{% else %}
    <h2>Cannot complete this transaction</h2>

    {% if tickets_soldout %}
        <h3>The following tickets have been sold out:</h3>

        {% for ticket in tickets_soldout %}
        <p>{{ ticket }}</p>
        {% endfor %}
    {% endif %}
{% endif %}

    <h2>Other Options:</h2>

    <form method="post" action="../">
    <p>
    <input type="submit" value="Start Over" />
    </p>
    </form>
</div>
{% endblock %}

